

package com.googlecode.flac4j.format.metadata;


/**
 *
 * @author Jin Kwon <jinahya at gmail.com>
 */
public final class BlockFactory {


    /**
     * Creates a new padding block.
     *
     * @param length padding length
     * @return a new padding block.
     */
    public static Block newPadding(final int length) {

        final Block block = new Block();

        block.setHeader(Header.newInstance(BlockType.PADDING));

        block.setData(Padding.newInstance(length)); // length is checked here

        return block;
    }


    /**
     * Creates a new instance.
     */
    private BlockFactory() {
        super();
    }


}

